

<!DOCTYPE html>
<html lang="zh" >

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>linux command - 天云的博客</title>
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="google" content="notranslate" />

  
  
  <meta name="description" content="Linux 命令注：随用随记，随时更新
du 命令

..."> 
  
  <meta name="author" content="天云"> 

  
    <link rel="icon" href="/images/icons/favicon-16x16.png" type="image/png" sizes="16x16">
  
  
    <link rel="icon" href="/images/icons/favicon-32x32.png" type="image/png" sizes="32x32">
  
  
    <link rel="apple-touch-icon" href="/images/icons/apple-touch-icon.png" sizes="180x180">
  
  
    <meta rel="mask-icon" href="/images/icons/stun-logo.svg" color="#333333">
  
  
    <meta rel="msapplication-TileImage" content="/images/icons/favicon-144x144.png">
    <meta rel="msapplication-TileColor" content="#000000">
  

  
<link rel="stylesheet" href="/zhangjun1024/css/style.css">


  
  
<link rel="stylesheet" href="//at.alicdn.com/t/font_1445822_onl0g0h21np.css">

  

  
  
  
<link rel="stylesheet" href="https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.min.css">

  

  
  
  
<link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.18.1/styles/xcode.min.css">

  

  <script>
    var CONFIG = window.CONFIG || {};
    var ZHAOO = window.ZHAOO || {};
    CONFIG = {
      isHome: false,
      fancybox: true,
      pjax: false,
      lazyload: {
        enable: true,
        onlyPost: 'false',
        loading: '/images/theme/loading.gif'
      },
      donate: {
        enable: true,
        alipay: '',
        wechat: '/images/wechat.jpg'
      },
      motto: {
        api: '',
        default: '临渊羡鱼，不如退而结网'
      },
      galleries: {
        enable: false
      },
      fab: {
        enable: false,
        alwaysShow: false
      },
      carrier: {
        enable: true
      },
      daovoice: {
        enable: true
      }
    }
  </script>

  

  
<meta name="generator" content="Hexo 5.2.0"></head>
<body class="lock-screen">
  <div class="loading"></div>
  


<nav class="navbar">
  <div class="left"></div>
  <div class="center">linux command</div>
  <div class="right">
    
    <i class="iconfont iconmenu j-navbar-menu"></i>
  </div>
</nav>

  <nav class="menu">
  <div class="menu-wrap">
    <div class="menu-close">
      <i class="iconfont iconbaseline-close-px"></i>
    </div>
    <ul class="menu-content">
      
      
      
      
      <li class="menu-item"><a href="/ " class="underline"> 首页</a></li>
      
      
      
      
      <li class="menu-item"><a href="/tags/ " class="underline"> 标签</a></li>
      
      
      
      
      <li class="menu-item"><a href="/categories/ " class="underline"> 分类</a></li>
      
    </ul>
    <div class="menu-copyright"><p>Powered by <a target="_blank" href="https://hexo.io">Hexo</a>  |  Theme - <a target="_blank" href="https://github.com/izhaoo/hexo-theme-zhaoo">zhaoo</a></p></div>
  </div>
</nav>
  <main id="main">
  <div class="container" id="container">
    <article class="article">
  <div class="wrap">
    <section class="head">
  <img   class="lazyload" data-original="/zhangjun1024/images/theme/post-image.jpg" src=""  draggable="false">
  <div class="head-mask">
    <h1 class="head-title">linux command</h1>
    <div class="head-info">
      <span class="post-info-item"><i class="iconfont iconcalendar"></i>October 29, 2020</span
        class="post-info-item">
      
      <span class="post-info-item"><i class="iconfont iconfont-size"></i>719</span>
    </div>
  </div>
</section>
    <section class="main">
      <section class="content">
        <h3 id="Linux-命令"><a href="#Linux-命令" class="headerlink" title="Linux 命令"></a>Linux 命令</h3><h4 id="注：随用随记，随时更新"><a href="#注：随用随记，随时更新" class="headerlink" title="注：随用随记，随时更新"></a>注：随用随记，随时更新</h4><ol>
<li>du 命令</li>
</ol>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs awk">du -sh *<br><span class="hljs-regexp">//</span>查看当前目录下文件和目录占用空间大小<br></code></pre></td></tr></table></figure>
<ol start="2">
<li><p>supervisor<br>supervisor 是用于守护进程的工具 <a target="_blank" rel="noopener" href="https://www.cnblogs.com/wyt007/p/8288929.html">https://www.cnblogs.com/wyt007/p/8288929.html</a></p>
</li>
<li><p>crontab<br>crontab 是一款定时任务的工具</p>
<p>crontab -e  直接编辑定时任务</p>
<p>crontab -l  列出所有定时任务</p>
<p>* * * * *  &nbsp;  命令， 前半部分代表时间，后半部分代表命令 从左到右每个位置分别代表分（0-59），时(0-23)，一个月中的第几天(1-31)，月(1-12)，一周中的第几天（0-6 0代表星期天）；例如：</p>
<figure class="highlight basic"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs basic"><span class="hljs-symbol">0 </span><span class="hljs-number">8</span> * * * ls 代表每天早上<span class="hljs-number">8</span>点执行ls 任务<br><span class="hljs-symbol">0 </span><span class="hljs-number">8</span> <span class="hljs-number">1</span> * * ls 代表每月<span class="hljs-number">1</span>日早上<span class="hljs-number">8</span>点执行 ls 任务<br></code></pre></td></tr></table></figure>
<p>当 */n 在分钟位置上时  表示每n分钟执行一次，在小时位置上时表示每n小时执行一次，以此类推</p>
<p>a-b 在分钟位置上表示第a分钟到b分钟要执行，以此类推</p>
</li>
</ol>
<figure class="highlight lsl"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs lsl"><span class="hljs-number">20</span> <span class="hljs-number">0</span><span class="hljs-number">-12</span>/<span class="hljs-number">2</span> * * * echo <span class="hljs-string">&quot;haha&quot;</span> 每天<span class="hljs-number">0</span><span class="hljs-number">-12</span>时每两小时的第<span class="hljs-number">20</span>分钟执行一次 echo <span class="hljs-string">&quot;haha&quot;</span> 即 <br>每天<span class="hljs-number">0</span>点<span class="hljs-number">20</span>，<span class="hljs-number">2</span>点<span class="hljs-number">20</span>，<span class="hljs-number">4</span>点<span class="hljs-number">20</span>  ......执行echo <span class="hljs-string">&quot;haha&quot;</span><br></code></pre></td></tr></table></figure>
<ol start="4">
<li>删除命令<figure class="highlight cmake"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs cmake">rm [<span class="hljs-keyword">option</span>] DirName<br></code></pre></td></tr></table></figure>
功能: 删除文件，文件夹</li>
</ol>
<p>-i 删除前逐一询问确认。</p>
<p>-f 即使原档案属性设为唯读，亦直接删除，无需逐一确认。</p>
<p>-r 将目录及以下之档案亦逐一删除,递归所有的子目录,逐一询问。</p>
<h2 id="未完-待续"><a href="#未完-待续" class="headerlink" title="未完 待续"></a>未完 待续</h2>
      </section>
      <section class="extra">
        
        <ul class="copyright">
  
  <li><strong>本文作者：</strong>天云</li>
  <li><strong>本文链接：</strong><a href="https://zhangjun1024.gitee.io/2020/10/29/linux-command/index.html">https://zhangjun1024.gitee.io/2020/10/29/linux-command/index.html</a></li>
  <li><strong>版权声明：</strong>本博客所有文章均采用<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"
      rel="external nofollow" target="_blank"> BY-NC-SA </a>许可协议，转载请注明出处！</li>
  
</ul>
        
        
        <section class="donate">
  <div class="qrcode">
    <img src="">
  </div>
  <div class="icon">
    <a href="javascript:;" id="alipay"><i class="iconfont iconalipay"></i></a>
    <a href="javascript:;" id="wechat"><i class="iconfont iconwechat-fill"></i></a>
  </div>
</section>
        
        
  <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/zhangjun1024/tags/linux/" rel="tag">linux</a></li></ul>

        
<nav class="nav">
  
    <a href="/zhangjun1024/2020/10/29/windows-server-2008r2-netcore-2-1/"><i class="iconfont iconleft"></i>windows server 2008r2 iis 服务器部署 netcore 2.1</a>
  
  
    <a href="/zhangjun1024/2020/10/28/net-core-01/">.net core 01<i class="iconfont iconright"></i></a>
  
</nav>

      </section>
      
    </section>
  </div>
</article>
  </div>
</main>
  <footer class="footer">
  <div class="footer-social">
    
    
    
    
    
    <a href="tencent://message/?Menu=yes&uin=1051599574 " target="_blank" onMouseOver="this.style.color= '#12B7F5'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconQQ "></i>
    </a>
    
    
    
    
    
    <a href="https://github.com/zhangjunL " target="_blank" onMouseOver="this.style.color= '#24292E'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  icongithub-fill "></i>
    </a>
    
    
    
    
    
    <a href="mailto:zhangjunx6497@163.com " target="_blank" onMouseOver="this.style.color='#FFBE5B'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconmail"></i>
    </a>
    
  </div>
  <div class="footer-copyright"><p>Powered by <a target="_blank" href="https://hexo.io">Hexo</a>  |  Theme - <a target="_blank" href="https://github.com/izhaoo/hexo-theme-zhaoo">zhaoo</a></p></div>
</footer>
  
  
</body>


<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>






<script src="https://cdn.bootcdn.net/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>






<script src="https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.min.js"></script>






<script src="/zhangjun1024/js/utils.js"></script>
<script src="/zhangjun1024/js/modules.js"></script>
<script src="/zhangjun1024/js/zui.js"></script>
<script src="/zhangjun1024/js/script.js"></script>





<script>
  (function (i, s, o, g, r, a, m) {
    i["DaoVoiceObject"] = r;
    i[r] = i[r] || function () {
      (i[r].q = i[r].q || []).push(arguments)
    }, i[r].l = 1 * new Date();
    a = s.createElement(o), m = s.getElementsByTagName(o)[0];
    a.async = 1;
    a.src = g;
    a.charset = "utf-8";
    m.parentNode.insertBefore(a, m)
  })(window, document, "script", ('https:' == document.location.protocol ? 'https:' : 'http:') +
    "//widget.daovoice.io/widget/0f81ff2f.js", "daovoice")
  daovoice('init', {
    app_id: "abcdefg"
  }, {
    launcher: {
      disableLauncherIcon: true,
    },
  });
  daovoice('update');
</script>



<script>
  (function () {
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
      bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    } else {
      bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
  })();
</script>


<script>
  var _hmt = _hmt || [];
  (function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?4c204d8bc027a0455b5fc642ac334ca8";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
  })();
</script>










</html>